<h2><a name="howto" id="howto">How to set up Apache</a></h2>
<p>There are two ways of configuring apache to support multiple
hosts. Either by running a separate <code class="program"><a href="../programs/httpd.html">httpd</a></code> daemon for
each hostname, or by running a single daemon which supports all the
virtual hosts.</p>
<p>Use multiple daemons when:</p>
<ul>
<li>There are security partitioning issues, such as company1
does not want anyone at company2 to be able to read their
data except via the web. In this case you would need two
daemons, each running with different <code class="directive"><a href="../mod/mpm_common.html#user">User</a></code>, <code class="directive"><a href="../mod/mpm_common.html#group">Group</a></code>, <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code>, and <code class="directive"><a href="../mod/core.html#serverroot">ServerRoot</a></code> settings.</li>
<li>You can afford the memory and file descriptor
requirements of listening to every IP alias on the
machine. It's only possible to <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code> to the "wildcard"
address, or to specific addresses. So if you have a need to
listen to a specific address for whatever reason, then you
will need to listen to all specific addresses. (Although one
<code class="program"><a href="../programs/httpd.html">httpd</a></code> could listen to N-1 of the addresses, and another could
listen to the remaining address.)</li>
</ul>
<p>Use a single daemon when:</p>
<ul>
<li>Sharing of the httpd configuration between virtual hosts
is acceptable.</li>
<li>The machine services a large number of requests, and so
the performance loss in running separate daemons may be
<h2><a name="single" id="single">Setting up a single daemon
with virtual hosts</a></h2>
<p>For this case, a single <code class="program"><a href="../programs/httpd.html">httpd</a></code> will service
requests for the main server and all the virtual hosts. The <code class="directive"><a href="../mod/core.html#virtualhost">VirtualHost</a></code> directive
in the configuration file is used to set the values of <code class="directive"><a href="../mod/core.html#serveradmin">ServerAdmin</a></code>, <code class="directive"><a href="../mod/core.html#servername">ServerName</a></code>, <code class="directive"><a href="../mod/core.html#documentroot">DocumentRoot</a></code>, <code class="directive"><a href="../mod/core.html#errorlog">ErrorLog</a></code> and <code class="directive"><a href="../mod/mod_log_config.html#transferlog">TransferLog</a></code>
or <code class="directive"><a href="../mod/mod_log_config.html#customlog">CustomLog</a></code>
configuration directives to different values for each virtual
<a href="../ja/vhosts/ip-based.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> |
<a href="../ko/vhosts/ip-based.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p>
</div><div id="footer">
<p class="apache">Copyright 1995-2006 The Apache Software Foundation or its licensors, as applicable.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>